flag_no_deps: bool,
flag_open: bool,
flag_verbose: bool,
+ flag_release: bool,
flag_quiet: bool,
flag_color: Option<String>,
flag_package: Option<String>,
-p SPEC, --package SPEC Package to document
--no-deps Don't build documentation for dependencies
-j N, --jobs N The number of jobs to run in parallel
+ --release Build artifacts in release mode, with optimizations
--features FEATURES Space-separated list of features to also build
--no-default-features Do not build the `default` feature
--target TRIPLE Build for the target triple
spec: options.flag_package.as_ref().map(|s| &s[..]),
exec_engine: None,
filter: ops::CompileFilter::Everything,
- release: false,
+ release: options.flag_release,
mode: ops::CompileMode::Doc {
deps: !options.flag_no_deps,
},
use support::{project, execs, path2url};
-use support::COMPILING;
+use support::{COMPILING, RUNNING};
use hamcrest::{assert_that, existing_file, existing_dir, is_not};
fn setup() {
assert_that(p.cargo_process("doc"),
execs().with_status(0));
});
+
+test!(doc_release {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+ "#)
+ .file("src/lib.rs", "");
+
+ assert_that(p.cargo_process("build").arg("--release"),
+ execs().with_status(0));
+ assert_that(p.cargo("doc").arg("--release").arg("-v"),
+ execs().with_status(0)
+ .with_stdout(&format!("\
+{compiling} foo v0.0.1 ([..])
+{running} `rustdoc src[..]lib.rs [..]`
+", compiling = COMPILING, running = RUNNING)));
+});